import { lk_buyer, lk_common, lk_expert, lk_seller, lk_manager, lk_consumer } from './myConfig.js';
function request(method, url, data, header) {
	return new Promise((resolve, reject) => {
		if (getApp().globalData._IsLogin_) {
			// console.warn("直接登陆："+url);
			requestX(method, url, data, header).then(function (data) {
				resolve(data);
			}).catch(function (data) {
				reject(data);
			})
		} else {
			// 设置定时器，等待登陆完成
			let cnt = 0;
			let tid = setInterval(() => {
				if (cnt > 500) { //设置最大等待时间
					clearInterval(tid);
					reject("请求超时，请刷新重试！");
					return;
				}
				// console.warn("等待登陆完成："+(++cnt));
				if (getApp().globalData._IsLogin_) {
					// console.warn("等待登陆成功："+cnt+" ---"+url);
					clearInterval(tid);
					requestX(method, url, data, header).then(function (data) {
						resolve(data);
					}).catch(function (data) {
						reject(data);
					})
				}
			}, 10)
		}
	})
}

function requestX(method, url, data, header) {
	let headers = Object.assign({
		'content-type': 'application/json',
		'accessToken': uni.getStorageSync('accessToken'),
		'refreshToken': uni.getStorageSync('accessToken')
	}, header)
	return new Promise((resolve, reject) => {
		// uni.hideLoading();
		uni.request({
			url,
			method,
			data,
			header: headers,
			success: ({
				data: res
			}) => {
				//  uni.hideLoading() 
				if (res && res.code.code === 200) {
					try {
						const _data_ = JSON.parse(res.data || '{}');
						resolve(_data_);
					} catch (error) {
						resolve(res.data);
					}
				} else {
					uni.showToast({
						title: res.message || '服务器响应超时,请稍后再试！',
						icon: 'none'
					});
					reject(res.message);
				}
			},
			fail: function (res) {
				console.log(res, 9999)
				uni.hideLoading();
				uni.showToast({
					title: res.message || '网络响应超时,请稍后再试！',
					icon: 'none'
				});
				reject(res.data);
			}
		});
	})
}

function requesthttpLogin(method, url, data, header) {
	let headers = Object.assign({
		'content-type': 'application/json',
	}, header)
	return new Promise((resolve, reject) => {
		uni.hideLoading();
		uni.request({
			url,
			method,
			data,
			header: headers,
			success: ({
				data: res
			}) => {
				uni.hideLoading();
				resolve(res);
			},
			fail: function (res) {
				uni.hideLoading();
				uni.showToast({
					title: res.message || '网络响应超时,请稍后再试！',
					icon: 'none'
				});
				reject(res);
			}
		});
	})
}

function requesthttp(method, url, data, header) {
	let headers = Object.assign({
		'content-type': 'application/json',
		'accessToken': uni.getStorageSync('accessToken'),
		'refreshToken': uni.getStorageSync('accessToken')
	}, header)
	return new Promise((resolve, reject) => {
		uni.hideLoading();
		uni.request({
			url,
			method,
			data,
			header: headers,
			success: ({
				data: res
			}) => {
				uni.hideLoading();
				resolve(res);
			},
			fail: function (res) {
				uni.hideLoading();
				uni.showToast({
					title: res.message || '网络响应超时,请稍后再试！',
					icon: 'none'
				});
				reject(res);
			}
		});
	})
}

function requestlist(method, url, data, header) {
	let headers = Object.assign({
		'content-type': 'application/json',
		'accessToken': uni.getStorageSync('accessToken'),
		'refreshToken': uni.getStorageSync('accessToken')
	}, header)
	return new Promise((resolve, reject) => {
		if (getApp().globalData._IsLogin_) {
			// console.warn("直接登陆："+url);
			requestlistX(method, url, data, header).then(function (data) {
				resolve(data);
			}).catch(function (data) {
				reject(data);
			})
		} else {
			// 设置定时器，等待登陆完成
			let cnt = 0;
			let tid = setInterval(() => {
				if (cnt > 500) { //设置最大等待时间
					clearInterval(tid);
					reject("请求超时，请刷新重试！");
					return;
				}
				// console.warn("等待登陆完成："+(++cnt));
				if (getApp().globalData._IsLogin_) {
					// console.warn("等待登陆成功："+cnt+" ---"+url);
					clearInterval(tid);
					requestlistX(method, url, data, header).then(function (data) {
						resolve(data);
					}).catch(function (data) {
						reject(data);
					})
				}
			}, 10)
		}
	})
}

function requestlistX(method, url, data, header) {
	let headers = Object.assign({
		'content-type': 'application/json',
		'accessToken': uni.getStorageSync('accessToken'),
		'refreshToken': uni.getStorageSync('accessToken')
	}, header)
	return new Promise((resolve, reject) => {
		// uni.hideLoading();
		uni.request({
			url,
			method,
			data,
			header: headers,
			success(res) {
				// uni.hideLoading();
				resolve(res.data);
			},
			fail: function (res) {
				// uni.hideLoading();
				uni.showToast({
					title: res.message || '网络响应超时,请稍后再试！',
					icon: 'none'
				});
				reject(res);
			}
		});
	})
}
//单点登录
function requestRight(method, url, data, header) {
	let headers = Object.assign({
		'content-type': 'application/json',
		'accessToken': uni.getStorageSync('accessToken'),
		'refreshToken': uni.getStorageSync('accessToken'),
	}, header)
	return new Promise((resolve, reject) => {
		// uni.hideLoading();
		uni.request({
			url: url,
			method,
			header: headers,
			success(res) {
				// uni.hideLoading();
				resolve(res.data);
			},
			fail: function (res) {
				// uni.hideLoading();
				uni.showToast({
					title: res.message || '网络响应超时,请稍后再试！',
					icon: 'none'
				});
				reject(res);
			}
		});
	})
}


export const mqyApis = {
	/**
	 * @param { }
	 * @description 获取当前登录用户接口  获取用户信息
	 */
	getMember: (data) => requesthttp('GET', `${lk_buyer}/buyer/passport/member`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { code, token }
	 * @description app扫码-登录确认：1同意, 0拒绝
	 */
	app_confirm: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/app_confirm`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { token }
	 * @description app扫码
	 */
	app_scanner: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/app_scanner`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	// /**
	//  * @param { newPassword }
	//  * @description 初始设置密码 
	//  * @detail 
	//  * @author mqy
	//  */
	// canInitPassword: (data) => requesthttp('PUT', `${url1}/buyer/passport/member/canInitPassword`, data, {
	// 	'content-type': 'application/x-www-form-urlencoded'
	// }),

	/**
	 * @param { password }
	 * @description 注销账号
	 */
	cancellation: (data) => requesthttp('PUT', `${lk_buyer}/buyer/passport/member/cancellation`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	// /**
	//  * @param { address, birthday, face, nickName, region, regionId, sex: 男1-女0 }
	//  * @description 修改用户自己资料
	//  * @detail 
	//  * @author mqy
	//  */
	// getMember: (data) => requesthttp('PUT', `${lk_buyer}/buyer/passport/member`, data, {
	// 	'content-type': 'application/x-www-form-urlencoded'
	// }),

	/**
	 * @param { studentId, userType }
	 * @description 通过学号-工号查询是否存在该用户
	 */
	isExists: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/isExists`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { }
	 * @description 注销接口，退出登录
	 */
	userLogout: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/logout`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { }
	 * @description 修改密码
	 */
	modifyPass: (data) => requesthttp('PUT', `${lk_buyer}/buyer/passport/member/modifyPass`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { }
	 * @description web-获取登录二维码
	 */
	pc_session: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/pc_session`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { refreshToken }
	 * @description 刷新token
	 */
	refreshToken: (data) => requesthttp('GET', `${lk_buyer}/buyer/passport/member/refresh/{refreshToken}`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { birthday,face,height,mobilePhone,nickName,number:学号/工号-必传,sex,targetType,userType:必传,username:必传,weight }
	 * @description 注册用户
	 */
	register: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/register`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { mobile, password, code }
	 * @description 通过短信重置密码
	 */
	resetByMobile: (data) => requesthttpLogin('POST', `${lk_buyer}/buyer/passport/member/resetByMobile`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { password }
	 * @description 修改密码
	 */
	login: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/resetPassword`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { beforeSessionStatus,token }
	 * @description web-二维码登录
	 */
	session_login: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/session_login/{token}`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { code, mobile }
	 * @description 短信登录接口
	 */
	smsLogin: (data) => requesthttpLogin('POST', `${lk_buyer}/buyer/passport/member/smsLogin`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { {verificationEnums}- {mobile} }
	 * @description 获取验证码
	 */
	getCodeByPhone: (data, verificationEnums, mobile) => requesthttp('GET', `${lk_common}/common/common/sms/${verificationEnums}/${mobile}`, data, {
		'content-type': 'application/json'
	}),

	/**
	 * @param { code, mobile }
	 * @description 账号解锁功能
	 */
	unlock: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/unlock`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { password,username }
	 * @description 登录接口 /buyer/passport/member/userLogin
	 */
	userLogin: (data) => requesthttpLogin('POST', `${lk_buyer}/buyer/passport/member/userLogin`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { accessToken }
	 * @description 获取枚举类型列表
	 */
	getDataList: (data) => requesthttp('POST', `${lk_common}/common/common/enum/dataList`, data, {
		'content-type': 'application/json'
	}),

	// /** 待测可删
	//  * @param { accessToken }
	//  * @description 获取枚举类型列表
	//  */
	// getSiteDetail: (data) => requesthttp('GET', `${lk_expert}/site/${data['id']}`, data, {
	// 	'content-type': 'application/x-www-form-urlencoded'
	// }),
	/**
	 * @param { verificationEnums: LOGIN }
	 * @description 获取校验接口,一分钟同一个ip请求10次 点击登录时滑块验证
	 */
	getSilder: (data) => requesthttp('GET', `${lk_expert}/common/common/slider/${verificationEnums}`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),
	/**
	 * @param { verificationEnums: LOGIN }
	 * @description 验证码预校验       
	 */
	postSlider: (data) => requesthttp('POST', `${lk_expert}/common/common/slider/${verificationEnums}`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),
	/**
	 * @param { idolId: 专家或者关注的人的id, type: 偶像类型, 0专家,1用户 pageSize,pageNumber }
	 * @description 查询_用户关注专家       
	 */
	findIdol: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/findIdol`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),
	/**
	 * @param { idolId: 专家或者关注的人的id, type: 偶像类型, 0专家,1用户 }
	 * @description 保存_用户关注专家       
	 */
	saveIdol: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/saveIdol`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),

	/**
	 * @param { address, birthday, face, nickName, region, regionId, sex}
	 * @description 修改用户自己资料-单条修改       
	 */
	editOwn: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/editOwn`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param { base64-选传,file-必传: file}
	 * @description 文件上传       
	 */
	uploadFiles: (data) => requesthttp('POST', `${lk_common}/common/common/upload/file`, data, {
		'content-type': 'multipart/form-data'
	}),

	/**
	 * @param { tag-状态栏: ALL-全部/WAIT_PAY-待付款/WAIT_SHIP-待发货/WAIT_ROG-待收货/CANCELLED-已取消/COMPLETE-已完成,
			   订单类型:NORMAL-商品/VIRTUAL-赠品/COURSE_PAY-课程/ONLINE_CONSULT-线上咨询/OFFLINE_REGISTER-线下挂号}
	 * @description 查询会员订单列表       
	 */
	getOrder: (data) => requesthttp('POST', `${lk_buyer}/buyer/user/userCourse/myCourseOrder`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param { tag-状态栏: ALL-全部/WAIT_PAY-待付款/WAIT_SHIP-待发货/WAIT_ROG-待收货/CANCELLED-已取消/COMPLETE-已完成,
	           订单类型:NORMAL-商品/VIRTUAL-赠品/COURSE_PAY-课程/ONLINE_CONSULT-线上咨询/OFFLINE_REGISTER-线下挂号}
	 * @description 查询会员订单列表       
	 */
	delOrder: (id) => requesthttp('DELETE', `${lk_buyer}/buyer/user/userCourse/${id}`, {}, {
		'content-type': 'application/x-www-form-urlencoded'
	}),
	/**
	  @params  
	  "courseSeriesId": 课程系列id,
	  "evaluateType": "评论类型 0评价 1回复",
	  "grade": 分数0到5,
	  "pid": 评价传0,
	  "userEvaluate": "评论内容"
	  */
	answerComment: (params) => requesthttp('POST',`${lk_manager}/courseSeriesBaseEvaluate/save`, params),
	/**
	 * @param { pageNumber,pageSize,type: 1002001-课程,1002002-基地,1002003-场地,1002004-话题}
	 * @description 查询收藏列表
	 */
	getSelectCollect: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/selectCollect`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),
	/**
	 * @param { dataIds,typeId: 1002001-课程,1002002-基地,1002003-场地,1002004-话题}
	 * @description 删除收藏
	 */
	delCollect: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/collect/delete`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),
	/**
	 * @param { courseSerie {categoryStr-课程类别str,courseCategory-教学的类型,expertName-专家名字,keyword-关键字,page-当前页,rows-每页显示多少条,sortField-排序的字段,sortType-排序的方式：desc ; asc,userId-当前用户id}}
	 * @description 查询会员订单列表       
	 */
	getCourse: (data) => requesthttp('POST', `${lk_expert}/expert/course/courseSeries/byPage`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {none}
	 * @description 获取课程类别集合       
	 */
	getCourseType: (data) => requesthttp('GET', `${lk_expert}/expert/course/courseCategory/list`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {none}
	 * @description 带条件分页查询数据       
	 */
	getSite: (data) => requesthttp('POST', `${lk_manager}/manager/trainingBase/trainingBase/pagelist`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {none}
	 * @description 获取课程类别集合       
	 */
	getSitetest: (data) => requesthttp('GET', `${lk_manager}/manager/trainingBase/trainingBaseStatistics/list`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {id}
	 * @description 根据ID获取实训基地信息 获取详情       
	 */
	getBaseDetail: (data) => requestRight('GET', `${lk_manager}/manager/trainingBase/trainingBase/${data.id}`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {}
	 * @description 场地预约-确认支付按钮       
	 */
	getPay: (data) => requesthttp('POST', `${lk_buyer}/buyer/user/userTrainingBase/orderTrainingBase/confirm`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {"keyword": "","page": 0,"rows": 0,"searchStatus": "","sortField": "","sortType": ""}
	 * @description 我的预约-基地预约  
	 */
	getMyTrainingOrder: (data) => requesthttp('POST', `${lk_buyer}/buyer/user/userTrainingBase/myTrainingOrder`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {"consultOpen": "","keyword": 0,"mobile": 0,"page": "","sortType": "","registerOpen": "",rows:0}
	 * @description 获取专家排序的集合 获取获取专家列表  
	 */
	getExpertSortList: (data) => requesthttp('POST', `${lk_expert}/expert/expert/expert/PC/expertSortList`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {"keyword": 0,"page": "","sortType": "",sortField: '',"status": 0,rows:0}
	 * @description  带条件分页查询数据  场地列表
	 */
	getSiteList: (data) => requesthttp('POST', `${lk_expert}/expert/site/site/pagelist`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {"keyword": 0,"page": "","sortType": "",sortField: '',"status": 0,rows:0}
	 * @description  根据ID获取场地信息   
	 */
	getSiteDetail: (data) => requesthttp('GET', `${lk_expert}/expert/site/site/${data.id}`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {"keyword": 0,"page": "","sortType": "",sortField: '',"status": 0,rows:0}
	 * @description  资讯分类展示关键字搜索   
	 */
	getInfoList: (data) => requesthttp('POST', `${lk_expert}/expert/information/information/pagelist`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {"keyword": 0,"page": "","sortType": "",sortField: '',"status": 0,rows:0}
	 * @description  根据ID获取资讯信息   
	 */
	getInfoDetail: (data) => requesthttp('GET', `${lk_expert}/expert/information/information/${data}`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {id}
	 * @description  根据ID获取专家信息   
	 */
	getExpertDetail: (data) => requesthttp('GET', `${lk_expert}/expert/expert/expert/${data}`, data, {
		'content-type': 'application/json'
	}),
	/**
 * @param {id}
 * @description  根据ID获取专家值班场地   
 */
	getsiteList: (data) => requesthttp('GET', `${lk_expert}/expert/site/site/byExpertId/${data.expertId}`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),
	/**
 * @param {id}
 * @description  获取专家坐班时间 
 */
	getExpertTime: (data) => requesthttp('GET', `${lk_expert}/expert/site/siteRoomTime/expertTimeDetail/${data.expertId}/${data.siteId}/${data.week}`, data, {
		'content-type': 'application/json'
	}),
	/**
* @param {id}
* @description  获取咨询人列表
*/
	getVisitList: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/findRelationUser`, data, {
		'content-type': 'application/json'
	}),
	/**
* @param {id}
* @description  确认挂号
*/
	addRegistered: (data) => requesthttp('POST', `${lk_buyer}/buyer/user/userRegister/save`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {id}
	 * @description  根据ID获取专家信息   
	 */
	// getExpertDetail: (data) => requesthttp('GET', `${lk_expert}/expert/expert/expert/${data}`, data, {
	// 	'content-type': 'application/json'
	// }),

	// /buyer/passport/member/user/collect
	/**
	 * @param {id}
	 * @description  保存 我的收藏  
	 */
	saveCollect: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/collect`, data, {
		'content-type': 'application/json'
	}),

	/**
	 * @param {dataId-数据id,typeId-收藏类型}
	 * @description   查询当前数据是否被收藏
	 */
	checkCollect: (data) => requesthttp('GET', `${lk_buyer}/buyer/passport/member/user/collect`, data, {
		'content-type': 'application/json'
	}),

	/**
	 * @param { "keyword": "","page": 0,"rows": 0,"status": 0,"userId": 0}
	 * @description   用户查询自己的咨询
	 */
	getListByUserConsultDTO: (data) => requesthttp('POST', `${lk_buyer}/buyer/order/userConsult/getListByUserConsultDTO`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param { userRegisterId}
	 * @description   用户取消咨询
	 */
	userConsultCancle: (data) => requesthttp('POST', `${lk_buyer}/buyer/order/userConsult/updateStatus/${data.userRegisterId}`, data, {
		'content-type': 'application/json'
	}),

	/**
	 * @param { "page": 1, "rows": 10,"status": 1}
	 * @description   分页条件查询 我的预约-挂号
	 */
	getMyApointment: (data) => requesthttp('POST', `${lk_buyer}/buyer/user/userRegister/pagelist`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param { "page": 1, "rows": 10,"status": 1}
	 * @description   根据ID获取挂号单
	 */
	getUserRegister: (data) => requesthttp('GET', `${lk_buyer}/buyer/user/userRegister/${data}`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param { "page": 1, "rows": 10,"status": 1}
	 * @description   分带条件分页查询数据 获取专家评论列表
	 */
	getExpertEvalList: (data) => requesthttp('POST', `${lk_expert}/expert/expert/expert/getExpertEvaluate`, data, {
		'content-type': 'application/json'
	}),

	/**
	 * @param { "expertId",userId,userEvaluate,userEvaluateTime +/@property {type} prop_name}
	 * @description   专家问诊评价新增或回复 新增评论
	 */
	addEval: (data) => requesthttp('POST', `${lk_expert}/expert/expert/expertEvaluate/save`, data, {
		'content-type': 'application/json'
	}),

	/**
	 * @param { "birthday": "","createTime": "","idCard": "","mobile": "","sex": 0,"userId": 0,"username": "","visitCardNo": ""}
	 * @description   用户绑定咨询人  添加就诊人
	 */
	addPatient: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/bindRelationUser`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {}
	 * @description   用户新增咨询
	 */
	saveConsult: (data) => requesthttp('POST', `${lk_buyer}/buyer/order/userConsult/save`, data, {
		'content-type': 'application/json'
	}),

	/**
	 * @param {"page": 0,"rows": 0, "status": 0}
	 * @description   用户取消挂号预约
	 */
	userRegisterCancel: (data) => requesthttp('PUT', `${lk_buyer}/buyer/user/userRegister/cancel/${data.id}`, data, {
		'content-type': 'application/json'
	}),

	/**
	 * @param {id}
	 * @description   查询场地周一到周日是否可预约  查询专家的场地是否可以预约
	 */
	getExpertSiteIsAppoint: (data) => requesthttp('GET', `${lk_expert}/expert/site/site/isReservable/${data.id}`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {id}
	 * @description   根据场地ID查询专家列表 
	 */
	getAllTimePeriodsBySiteId: (data) => requesthttp('GET', `${lk_expert}/expert/site/siteRoomTime/allTimePeriodsBySiteId/${data.siteId}/${data.week}`, data, {
		'content-type': 'application/json'
	}),
	/**
	 * @param {id}
	 * @description   关注专家
	 */
	 concernExpert: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/saveIdol`, data, {
		'content-type': 'application/x-www-form-urlencoded'
	}),
	/**
	 * @param {id}
	 * @description   根据场地ID查询专家列表 
	 */
	// getAllTimePeriodsBySiteId: (data) => requesthttp('GET', `${lk_expert}/expert/site/siteRoomTime/expertTimeDetail/${data.expertId}/${data.siteId}/${data.week}`, data, {
	// 	'content-type': 'application/json'
	// }),

	/**
	 * @param {pageNumber:int,pageSize:int}  
	 * @description 查锻炼记录
	 */
	getExerciseRecordAsync: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/user/queryExerciseRecord`, data, {
		"content-type": "application/x-www-form-urlencoded"
	}),

	/**
	 * @param {
				content:string,
				createTime:year-month-day,
				pic:string
			}
	 * @description 保存锻炼记录
	 */
	saveExerciseRecordAsync: data => requesthttp("POST", `${lk_buyer}/buyer/passport/member/user/saveExerciseRecord`, data, {
		"content-type": "application/json"
	}),
	/**
	 * @param {
				id
			}
	 * @description 删除锻炼记录
	 */
	deleteExerciseRecordAsync: (data) => requesthttp("DELETE", `${lk_buyer}/buyer/passport/member/user/deleteExerciseRecord/${data.ids}`, data, {
		"content-type": "application/x-www-form-urlencoded"
	}),

	/**
	 * @param {
				id
			}
	 * @description 删除患者信息
	 */
	deleteRelationUserAsync: (data) => requesthttp("POST", `${lk_buyer}/buyer/passport/member/user/deleteRelationUser`, data, {
		"content-type": "application/x-www-form-urlencoded"
	}),
	/**
	 * @param {
				realName, idCard
			}
	 * @description 通知认证结果
	 */
	postSendResult: (data) => requesthttp('POST', `${lk_buyer}/buyer/passport/member/realAuthentication`, data, {
		'content-type': 'application/json'
	}),

	// 实名认证
	/**
		* @param { }
		* @description 发起金融级实人认证请求
		* @detail ？
		*/
	initFaceVerify: (data) => requesthttp('POST', `${lk_common}/common/common/facebody/initFaceVerify`, data, {
		'content-type': 'application/json'
	 }),
	 
	 /**
		* @param { }
		* @description 验证实人认证结果
		* @detail ？
		*/
	 verifyResult: (data) => requesthttp('POST', `${lk_common}/common/common/facebody/describeFaceVerify`, data, {
		'content-type': 'application/json'
	 }),
	 
	     /**
	  * @param {id}
	  * @description  根据ID获取专家课程   
	  */
	     getTestList: (data) => requesthttp('POST', `${lk_expert}/expert/course/courseSeries/pagelist`, data, {
	         'content-type': 'application/json'
	     }),
	 
	 //以下全是基地请求
	 // 获取基地所有评论请求
	  /**
	   * @param {id}
	   * @description  根据ID获取专家课程   
	   */
	  
	      baseevaluate: (data) =>requesthttp('POST', `${lk_manager}/manager/trainingBase/trainingBaseEvaluate/pagelist`, data, {
	          'content-type': 'application/json '
	      }),
	  
	  // 获取基地信息
		/**
		 * @param {id}
		 * @description  根据ID获取专家课程   
		 */
		
		getISISinfo: (data) =>requesthttp('POST', `${lk_manager}/manager/trainingBase/trainingBase/${data.id}`, data, {
		        'content-type': 'application/json '
		    }),
		
		// 获取基地详细信息
				/**
				 * @param {id}
				 * @description  根据ID获取专家课程   
				 */
				
				getISISinfoall:(data) => requestRight('GET', `${lk_manager}/manager/trainingBase/trainingBase/${data.id}`, data, {
		'content-type': 'application/json'
	}),
	// 更新回复数据
	/**
				 * @param {id}
				 * @description  根据ID获取专家课程   
				 */
				
				newcall:(params) => requestRight('POST', `${lk_manager}/manager/trainingBase/trainingBaseEvaluate/save`, params, {
		'content-type': ' application/json '
	}),
	  
	  // 以上全是基地请求


	/**
	   * @param { }
	   * @description 验证实人认证结果
	   * @detail ？
	   */
	verifyResult: (data) => requesthttp('POST', `${lk_common}/common/common/facebody/describeFaceVerify`, data, {
		'content-type': 'application/json'
	}),

	/**
 * @param {id}
 * @description  根据ID获取专家课程   
 */
	getTestList: (data) => requesthttp('POST', `${lk_expert}/expert/course/courseSeries/pagelist`, data, {
		'content-type': 'application/json'
	}),
	/**
 * @param {id}
 * @description  根据ID订阅   
 */
	 getnpm: (data) => requesthttp('POST', `${lk_buyer}/buyer/user/userTrainingBase/orderTrainingBase/confirm`, data, {
		'content-type': 'application/json'
	}),
	/**
	* @param {data}
	* @description  获取基地类型列表  
	*/
		 gettype: (data) => requesthttp('GET', `${lk_manager}/manager/trainingBase/trainingBase/getTrainingBaseCategory`, data, {
			'content-type': 'application/json'
		}),
		/**
		* @param {data}
		* @description  获取基地二级回复 
		*/
			 getcall: (data) => requesthttp('POST', `${lk_manager}/manager/trainingBase/trainingBaseEvaluate/save`, data, {
				'content-type': 'application/json'
			}),
	/**
	* @param {data}
	* @description  基地详情评价接口 
	*/
	goodcall: (data) => requesthttp('GET', `${lk_manager}/manager/trainingBase/trainingBaseEvaluate/getBaseCount/${data.id}`, data, {
			'content-type': 'application/x-www-form-urlencoded'
	}),		
}

